package jmine.tec.web.wicket.component.autocomplete;

import java.util.Locale;

import org.apache.wicket.util.convert.IConverter;

/**
 * Converter para {@link NaturalKeyAutoCompleteEntity}
 * 
 * @author Gallardo
 */
public class NaturalKeyAutoCompleteEntityConverter implements IConverter {

    /**
     * {@inheritDoc}
     */
    public Object convertToObject(String value, Locale locale) {
        NaturalKeyAutoCompleteEntity entity = new NaturalKeyAutoCompleteEntity();
        entity.setNaturalKey(value);
        return entity;
    }

    /**
     * {@inheritDoc}
     */
    public String convertToString(Object value, Locale locale) {
        return value.toString();
    }
}
